package cn.tedu.properties.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.time.LocalDateTime;
import java.util.Date;

@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
@TableName("property") //指定表名 和数据库中具体的表进行映射
public class Property {
    /*这里用的mybatis-plus,插入数据时它会自动生成id，该id是雪花算法生成的id，数据库id字段设置为bigint，
    所以属性的类型要用long,不然怕装不下,如果不想生成这么长的id就在属性上加个注解*/
    @ApiModelProperty(value = "资产id")
    @TableId(value = "id", type = IdType.AUTO)
    Long id;
    @ApiModelProperty(value = "资产名")
    String assetName;
    @ApiModelProperty(value = "资产编号")
    String assetCode;
    @ApiModelProperty(value = "资产类别id")
    Integer categoryId;
    @ApiModelProperty(value = "资产类别")
    String assetCategory;
    @ApiModelProperty(value = "品牌")
    String brand;
    @ApiModelProperty(value = "状态")
    Byte status;
    @ApiModelProperty(value = "备注")
    String remark;
    @ApiModelProperty(value = "资产入库时间")
    Date addTime;
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)//用于MP在插入或更新数据时自动填充
    LocalDateTime createTime;
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.UPDATE)//用于MP在插入或更新数据时自动填充
    LocalDateTime updateTime;
    @ApiModelProperty(value = "删除时间")
    LocalDateTime deleteTime;

    /*下面这俩是 在资产申请时赋值*/
    @ApiModelProperty(value = "员工ID")
    Long employeeId;
    @ApiModelProperty(value = "员工姓名")
    String employeeName;
}
